home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / utilitys / print15a / part02 / print.doc < prev   
Text File  |  1991-03-14  |  20KB  |  424 lines

  1. **************************************************************************
  2.                    P R I N T   D O C U M E N T A T I O N
  3.                           V E R S I O N    1 . 5A
  4. **************************************************************************
  5.  
  6. 1 WHY DID I WRITE PRINT?
  7.     Well,  this  might  be considered an intelligent question if you look at
  8. the  thousands of different printer drivers, handlers and the like that are
  9. available in the public domain today.  Well, none of them could truly solve
  10. half  of my printing problems, so I decided to write my own.  I didn't want
  11. it  to  be  one  of  these fancy handler-style, deep-into-dos-an'-exec-like
  12. programs  (I'm  not  a  capacity  in this area anyway), it should just be a
  13. relatively small and easy to handle & comprehend CLI program.
  14.  
  15.     What  also  kinda'  p..   me off was the fact that no program was really
  16. interested  in  what  I had set via preferences, nor did the printer behave
  17. properly  in  the  handling of German characters or braces and parenthesis.
  18. There  stood  this  fantastic piece of hardware (a P6+ in my special case),
  19. connected  to  an even more fantastic computer, and I should not get what I
  20. wanted?   So  I  sat down and coded this thinging of which you are just now
  21. reading the docs.
  22.  
  23. 2 WHAT PRINT DOES
  24.     Print  lets  you  sort  of completely specify the output of your printer
  25. without  having  to enter and change preferences every two minutes or so or
  26. having  to  break  your fingers to get to the dip switches of your printer.
  27. Print  will  handle  special German umlauts correctly and map them to their
  28. proper  values as well as intercept the thousands of form feeds that mainly
  29. utility programmers love to put into their text files :-)
  30.  
  31.     In  addition  Print will allow you to change type size and print quality
  32. of your printer and lots of other neat things.
  33.  
  34.     As  far  as  I  know Print is the first program for the Amiga which gets
  35. German users both Umlauts AND brackets in one go without using the graphics
  36. mode.  If I'm wrong, please tell me so I can shoot myself...
  37.  
  38. 3 RESTRICTIONS & KNOWN BUGS
  39.     Sorry   for   all   those   scientists   among  you  who  enjoy  reading
  40. broken-up-in-half  lines of text on ripped perforations.  I set the default
  41. to skip this piece of paper...
  42.  
  43.     Print  has never been tested on any other printer than my NEC.  It might
  44. happen that errors come up if the command set is loaded by scan_file().  If
  45. they do, please let me know.
  46.  
  47.     When  using  different  printer fonts than the IBM (yuck!) one, problems
  48. might come up when characters are mapped.
  49.  
  50.     In  addition,  Print does not currently map the whole IBM font correctly
  51. to  the Amiga's keymap, but this should not really pose a problem if you're
  52. not trying to print ANSI files :-)
  53.  
  54. Print needs both the arp.library and the req.library.
  55.  
  56. 4 HOW TO USE PRINT
  57.     Print is called from the CLI with the command line
  58.  
  59.         1> Print [options] {switches} file1 ... file20
  60.  
  61. you  can  mix  up options, switches and file names to your heart's content.
  62. Print  will  consider  everything  not beginning in a '-' (minus sign) as a
  63. name  of  a  file to be processed.  VERY IMPORTANT:  You MUST leave a space
  64. between  an  option  and  its argument.  If you fail to comply to this rule
  65. Print  will  just  ignore  the  value  and  assume the default value of the
  66. certain  option.   'Print -p 45 myfile' would be a valid command line which
  67. would set the pagelength to 45 lines of text, for instance.
  68.  
  69.     Another nice feature:  if you don't give a filename Print will just send
  70. the specified options and switches to the printer.  This means you are able
  71. to  adjust  your  printer  without having to touch it.  Make sure that your
  72. printer is online when you use Print this way, otherwise Print won't return
  73. until is is able to write the commands to the printer, e.g.  the printer is
  74. online.
  75.  
  76.  
  77. 5 OPTIONS AND SWITCHES
  78.     Remember, online help is available at any time by typing
  79.  
  80.             Print h
  81.  
  82. to  the  CLI  prompt.   Print will then give you a brief description of the
  83. commands and switches it knows about.
  84.  
  85. 6 LIST OF OPTIONS
  86.     Options  are  commands  which  require an argument to be supplied by the
  87. user.   In  order  not to have to type tons of numbers to the program, I've
  88. tried  to  keep  the  numbers  of  options  small or at least set them to a
  89. sensible  default  value.   Over  here  in Germany, most people use fanfold
  90. paper  for  example,  which will take 72 lines of output without a problem,
  91. and  due  to  the fact that I initially wrote this program for ME :-) i set
  92. most  of  the  default values in such a manner that the result would please
  93. me.  Should your wishes totally diverge from mine, go and write yourself an
  94. alias which automatically inserts your favourite options and switches.
  95.  
  96.     -f file    Read printer command sequences from file. See following sections
  97.             for more details.
  98.  
  99.     -i        This number will determine the number of blanks that
  100.             Print puts in front of each line. The range of this
  101.             value is 1 to 30, the default is 8 spaces.
  102.  
  103.     -l        The value given after this option sets the number of
  104.             lines on each page. Note that this value is not the 
  105.             amount of lines actually written out. Some space
  106.             is kept on top and at the bottom of a page for the
  107.             optional footline. The range is 2 to 100 lines per page,
  108.             the default value is 72.
  109.  
  110.     -t        The argument given to this option will determine how
  111.             many spaces are written to the printer for each tab.
  112.             This is a very neat option which will make your 
  113.             printouts look really nice! The range is 1--16 spaces
  114.             per tab, the default being 3.
  115.  
  116.     -u        This is for all you users who insist on using a different
  117.             national char set than the USA default setting. Print is
  118.             programmed in such a way that the mapping of chars will
  119.             only work properly if the printer is in USA mode. As there 
  120.             is no known means of getting the printer's default char set
  121.             you use, this is the place to put the char set number. When
  122.             printing of  the last file is finished, Print will tell the
  123.             printer to switch back to the specified char set.
  124.             The range of this value according to NEC specs is 0--14,
  125.             with Print's value defaulting to 2 (German char set). Omitting
  126.             this options might cause strange results when printing 
  127.             listings with lots of parenthesis and the like.
  128.             To find out which number your char set is just take a look
  129.             at the printer manual.
  130.     
  131.     -o        This option tells Print that the print head is not exactly
  132.             at the beginning of the paper (i.e., the perforation) but is 
  133.             offset by n millimeters. I chose this unit because it allows
  134.             the use of integer arithmetic, and I don't wanted Print to
  135.             get blown up by the floating point library. The option 
  136.             "-o 60" would tell Print that the paper is 60 mm further down
  137.             (or up, rather) the drain than normal. The range of this value
  138.             is from 0 to 300 millimeters. If Print fails to convert your
  139.             given parameter, the default value of 62 mm is used (in the
  140.             case of the P6+ the distance from the print ruler to the
  141.             rim of the back top plastic cover).
  142.             Note that Print bases it calculations on the 6 LPI setting!
  143.  
  144. 6.1 THE PRINTER COMMAND FILE
  145.     If you're not lucky enough to own a NEC, you can use the command file to
  146. change  the  programs command table.  Each line in this file (which you can
  147. create  using  your  favourite  editor)  must  consist  of  five  hex bytes
  148. separated  by  spaces  or tabs and a string at the end denoting the printer
  149. command to be set.  For example, the line
  150.  
  151.     1c 48 ff 00 00 tencpi
  152.  
  153. would  tell Print that your printers command for switching to 10 CPI is "1c
  154. 48".   The  byte "ff" is used to indicate the end of the command.  Not that
  155. even  though  the  above  command is only two bytes long you MUST give five
  156. bytes in the line.  This is due to the fact that the array is five bytes in
  157. length  to  provide storage for veeeryy long commands too.  Apart from that
  158. the  scanning  of  the  command  file  is  still done via fscanf() (yuck!!)
  159. because I was once again too lazy to think of any other way, and especially
  160. programmers  know that this routine behaves funnier than your mother in law
  161. if it does not get what it expects :-)
  162.  
  163. Another example: The command file line 
  164.  
  165.     1b 43 ff 00 00 lperpage
  166.  
  167. is  the  command  to  set  the  pagelengh  to  n  lines  according  to  the
  168. manufacturers specs.  Note that the two "00"'s are used as padding bytes to
  169. make total byte number add up to five.  When Print sends the command to set
  170. a certain page length to the printer, it will scan the command table, write
  171. the  bytes it finds to "PAR:" until it encounters the "ff", telling it that
  172. this is the end of the command.  If the command requires an argument, Print
  173. will send the argument directly afterwards to the printer.
  174.  
  175.     Here  is  list  of the commands the parser (hmm, well, a simple parser!)
  176. understands:
  177.  
  178.     "tencpi"                    ---    switch to 10 CPI
  179.     "twelvecpi"                ---     "       " 12 CPI
  180.     "fiftcpi"                ---     "       " 15 CPI
  181.     "setquality"            ---    switch to NLQ
  182.     "setdraft"                ---    switch to High Speed Draft
  183.     "neglinefeed"            ---   perform a negative line feed
  184.     "loudness"                ---    full speed printing
  185.     "quiet"                    ---     half speed printing
  186.     "resetprinter"            ---    full printer reset
  187.     "changecharusa"        ---   switch to USA char set
  188.     "changecharother"        ---   switch to other than USA set
  189.     "set8lpi"                ---   switch to 8LPI
  190.     "set6lpi"                ---   switch to 6LPI
  191.     "underline"                ---   set underline for file name & date
  192.  
  193. If you don't name all of these commands in the command file, Print will use
  194. the default NEC settings for the undefined ones.  This might result in some
  195. funny  characters appearing in your printout.  To get rid of these just set
  196. the  sequences  to harmless spaces (0x20) which end in the command end byte
  197. "ff"  or  don't use them via command line switches.  If your printer is not
  198. capable of, say, quiet printing, use the command file line
  199.  
  200.     ff 00 00 00 00 quiet 
  201.  
  202. to prevent the appearance of funny escape characters.
  203.  
  204.     The command file line
  205.  
  206.     20 20 20 20 ff underline
  207.  
  208. would convert the underline command to four harmless spaces.
  209.  
  210.     Oh, I forgot: ALL COMMANDS MUST CONSIST OF LOWER CASE CHARACTERS.
  211.  
  212. 7 LIST OF SWITCHES
  213.     Switches don't take an argument. Put them anywhere you like!
  214.  
  215.     -B        Selects the "BIG" 10 cpi font.
  216.     -M           "     "  "MEDIUM" 12cpi font (DEFAULT)
  217.     -S            "     "  "SMALL"  15cpi font.
  218.  
  219.     -F        if given, the first line of the printout will be the
  220.             name of the file. The default is not to print the filenames.
  221.             Also prints the date.
  222.  
  223.     -P        turns on the pagenumbering. The counter will be reset to 1
  224.             after each file printed. (Default is off)
  225.  
  226.     -Q        this switch selects near letter quality mode of the PinWriter.
  227.             This is also the default print mode (we want our listings
  228.             to look nice, don't we?).
  229.  
  230.     -D        selects the draft mode (fast, but ugly, yuck!). For those
  231.             among you who are always in a terrible hurry.
  232.  
  233.     -N        selects quiet (half speed) print mode.
  234.  
  235.     -R        Inhibits resetting the printer after last file. This is for
  236.             people who trust this program!
  237.  
  238.     -T        If you do not want incoming characters to be mapped to their
  239.             IBM char set equivalents, use this option.
  240.  
  241.     -8        Causes Print to use the 8LPI jammed print mode. 
  242.  
  243. Note that the program discriminates between upper and lower case letters!
  244.  
  245. 7.1    CALLING PRINT FROM THE WORKBENCH
  246.     To  call Print from the Workbench double-click on its icon.  At the time
  247. this  is  written it's not clear wether I'll include the parameter passing.
  248. The current version however will not accept passed parameters.
  249.  
  250. Using  Print  on  the  Workbench  is a pretty straight forward job:  If you
  251. doubleclick the icon or type
  252.  
  253.     1> Print15a
  254.  
  255. to  the  CLI  prompt,  print will open up a window on the Workbench screen.
  256. The  functions  of Print are then controlled via the various gadgets.  Note
  257. that  not all options and switches of Print are usable from this window.  I
  258. introduced  this  facility  to provide a shortcut invocation of Print for a
  259. fast  print  job  where  you  don't have to set options like page length or
  260. alternate national printer char set.
  261.  
  262.     The  rest  is quite self-explanatory stuff, really.  If you click around
  263. the  gadgets a bit you'll notice which values you can use from this window.
  264. To  print  a  file, enter your favourite settings and then click the "Print
  265. File"  gadget.  This will bring up the famous ARP file requester which lets
  266. you  select  the  filename.   When done, click the requester's "OK" gadget.
  267. Print  will  then start the print job and change the print gadget's text to
  268. "Please wait" until it is ready to take on the next job.
  269.  
  270.     Print  also  lets you use the values that were set with Preferences, and
  271. now  you  can  even  be  sure that the values will actually be used for the
  272. printout  :-) Click on the "prefs" gadget to the right of the "info" gadget
  273. to load the preferences settings.
  274.  
  275.     Click  on  the  "info"  gadget  in  the  upper  right  hand corner to get
  276. information on the legal stuff.
  277.  
  278.     If  you don't need Print and want the clumsy window out of the way for a
  279. while,  just  click  the  "Have a nap" gadget.  Print will then iconify its
  280. window  and  reduce  the  priority of its task to -10 to avoid blocking the
  281. system  (of course WaitPort is used to wait for messages!).  Doubleclicking
  282. the icon will reopen Print's window and restore priority to 0.
  283.  
  284.    The "req" gadget will let you choose between arp's and the req.libraries
  285. file requester, the default being req.library.
  286.  
  287.    To get information concering the time print needs to print a file, click
  288. the  "pre"  gadget  and choose the file you want to print.  The information
  289. Print gives is of course only approximate and valid for the NEC P6+.
  290.  
  291. 8 THE LEGAL STUFF
  292.     Print  is  copyright  (c)  HooverSoft  1990.  All rights remain with the
  293. author  of  this program, Uwe "Hoover" Schurkamp.  Permission is granted to
  294. distribute  this  program  freely provided no fee is charged and that it is
  295. distributed  in  its  unmodified zoo file together with this documentation.
  296. Explicit permission is granted to Fred Fish to include this program and all
  297. its  files  in his library and for everyone who wants to put it on a BBS or
  298. usenet-like facility.
  299.  
  300.     If  you  feel this program comes in handy and if you use it on a regular
  301. basis  I  ask you to make a donation to your favourite charity (Cheers, Art
  302. Skiles,  for the idea!) like Greenpeace or whatever you like.  Please don't
  303. forget to worry about this planet, the worlds that the AMIGA creates aren't
  304. real...
  305.  
  306. 9 DISCLAIMER
  307. HooverSoft  makes no warranty whatsoever to the fitness of this program for
  308. use and disclaims liability for any damage resulting from the use of Print.
  309. In other words:  Use it if you dare!
  310.  
  311. 10 PRINT REVISIONS AND SMALL HISTORY
  312. Version 0.01:
  313.     Wouldn't  dare  call  this  a  release.  Just coded something because of
  314. boredom...  Introduced multiple file names and the like.
  315.  
  316. Version 1.00:
  317.     Coded  help,  user  settable  type  size, interception of Form feeds and
  318. inclusion of file names.  Kicked the concept of using spool files as output
  319. to  send  data  directly to PAR:  Also programmed settable perforation jump
  320. (with  VERY  strange  results).  Tooks lots of pains to make Print's banner
  321. look nice (the 'nec' stuff appears purple on my prefs, hmmm :-)
  322.  
  323. Version 1.01:
  324.         Once  again  kicked  concept  of  using  NEC's  auto jump.  Print now
  325. 'simulates'  perforation  skip by printing lots of \n's.  Introduced option
  326. to print out page numbers.  Things seem to go quite well!
  327.  
  328. Version 1.02:
  329.     Printing  quality  is now user settable via -Q and -D options.  Killed a
  330. bug  in  the  interception  of  ff's  (Print  really  didn't  capture them,
  331. whooops...)
  332.  
  333.     Also  did  some  optimization  on  the code like getting rid of obsolete
  334. options and the like.
  335.  
  336. Version 1.03:
  337.     Fixed  a  bug  with  first  printed  line  that Print refused to indent.
  338. Thoroughly tested Print's performance on a couple of really long files.
  339.  
  340. Version 1.04:
  341.     Print  should  now be a bit shorter (did some optimization on the code).
  342. Removed  superfluous  cr after printing of last file.  The paper should end
  343. up just right now after printout.  Added switches -N and -R.
  344.  
  345. Version 1.1:
  346. Introduced  a  new option -u to take other national char sets into account.
  347. Fixed a bug in the PutCommand()-routine.
  348.  
  349. There  might  have been a very big bug in earlier versions which could have
  350. caused  Print  to not perform as advertised:  I left out an init of an auto
  351. variable  which  could  have jammed up the command table.  Well, no one has
  352. complained so far...
  353.  
  354. The  biggest  improvement  is  perhaps  the  ability to load other printers
  355. command  sets.   As  I only have one printer, I really rely on you to point
  356. out any error!
  357.  
  358. VERSION 1.11:
  359. Introduced offset option and killed a bug that would cause the NEC to print
  360. BACKWARDS  if  you  didn't  use  -R  switch.   Boy,  that's funny!  Maybe I
  361. shouldn't  drink  so  much  wine  when programming...  Print now resets the
  362. printer by default.  Print now also maps the "1/2" char correctly.
  363.  
  364. VERSION 1.2:
  365. 8LPI  printing  introduced.   -T  switch  added.  couple of other minor bug
  366. fixes.
  367.  
  368. VERSION 1.5A:
  369. MAJOR  rewrite  of  Print  which  now  looks  a  totally different program!
  370. Included  Workbench  startup,  huge  requester and making use of ARP's file
  371. requester.   It's  been  a lot of work, but I think it has payed off in the
  372. end,  don't  you think?  Changes are too many to mention them in detail, so
  373. go and find out yourselves.
  374.  
  375. 11 BUGS AND FLEAS
  376.     If  you  find any of these ugly creatures in my great code (hu hu) worth
  377. mentioning drop me a line on bitnet to
  378.  
  379.         hoover@math4.uni-bielefeld.de
  380.  
  381. or by SNAIL to
  382.  
  383.         Uwe Schurkamp
  384.         Jollenbecker Weg 4
  385.         D-4900 Herford
  386.  
  387.     Print  is  quite  a large program (for my standards anyway), and testing
  388. all its features in combination with each other would probably use up about
  389. half  a  rain  forest's  worth of paper.  Well, I wrote Print to get rid of
  390. tons  of  unsatisfying  printouts,  and I DO rely on my users to report any
  391. errors.
  392.  
  393. 12 THE CREDITS
  394.     Cheers  to  JENS  MENSCHING  for many bug reports and the idea to put an
  395. Inutition  interface  into  Print.   The Print icon is by courtesy of MAGIC
  396. MOUSE  Inc.   (alias  BERND  HEIDE, who has not yet decided to take on this
  397. name  :-)  ...   I really like it!  Also LEO SCHWAB requires mentioning his
  398. name  in  the docs if you use his iconify() routine...  Thanks, Leo!  (Note
  399. for  the  users:   If  Print gurus on you when iconifying, drop Leo a line!
  400. ;-)  Leo's  routine  is  a MUST for any serious program (which doesn't mean
  401. Print  is  a serious program!).  Cheers also to the guys who programmed the
  402. fantastic req.library.
  403.  
  404.     Last  but not least a big "thanks" to MY WIFE for allowing the time with
  405. this  great  piece  of  technology (she couldn't play MechForce while I was
  406. hacking...)  and to MY unborn SON for delaying his arrival until I finished
  407. this program (if there is something like a "final release" of a program).
  408.  
  409.  
  410. enjoy & be lucky
  411.  
  412.         hoover
  413.  
  414. P.S.: play NetHack!
  415.  ___________________________________________________________________________
  416. |---------------------------------------------------------------------------|
  417. |  Weinberg's Law:                          ||            //// Only Amiga   |
  418. |  "If builders built buildings the way     ||           //// makes it      |
  419. |  programmers write programs, then the     ||     \\\\ //// possible!      |
  420. |  first  woodpecker  that  came  along     ||      \\\X/// hoover@math4.   |
  421. |  would destroy civilisation."             ||       \XXX/ uni-bielefeld.de |
  422. |---------------------------------------------------------------------------|
  423. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  424.